package cn.iocoder.yudao.module.contract.job;

import cn.hutool.core.date.DateUtil;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.module.contract.service.invoice.InvoiceService;
import cn.iocoder.yudao.module.contract.webservice.ContractWebService;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

@Component
@Slf4j
public class InvoiceJob implements JobHandler {
    @Resource
    private InvoiceService invoiceService;

    @Override
    public String execute(String param) {
        Date endDate = new Date();
        Date StringDate = DateUtil.offsetHour(endDate,-1);
        return invoiceService.invoiceSync(DateUtil.formatDateTime(StringDate),DateUtil.formatDateTime(endDate));
    }
}
